<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    .curtain{
        position:absolute;
        width:100%;
        height:100%;
        background-color: gold;
        opacity: .5;
        display: none;
    }
</style>
<body>
<div class="curtain">

</div>
<button class="ajax">ajax</button>
<button class="post">post</button>

</body>
<script src="jquery-3.4.1.js"></script>
<script>
    $(function () {
        $(".ajax").click(function () {
            $.ajax({
                url:"http://47.107.100.125:8080/api/home/getAgreement",
                type:"post",
                data:{language:"zh"},
                success:function (data) {
                    console.log(data);
                },
                error:function (XMLHttpRequest,textStatus,errorThrown) {
                    console.log("请求失败");
                    console.log(XMLHttpRequest);
                    console.log(textStatus);
                    console.log(errorThrown);
                },
                complete:function () {
                    console.log("请求结束")
                }
            })
        });

        $(document).ajaxStart(function () {
            $(".curtain").show();
        })

        $(document).ajaxStart(function () {
            $(".curtain").hide();
        })
    })
</script>

</html>